package biz;

import bean.companyInfo;
import mapper.companyMapper;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.InputStream;
import java.util.List;
import java.util.Set;

@Service
public class companyBiz {
    private SqlSession session;
@Autowired
    private companyMapper cm;
    public companyBiz(){
        InputStream io=companyBiz.class.getClassLoader().getResourceAsStream("comfig.xml");
        SqlSessionFactory ssf=new SqlSessionFactoryBuilder().build(io);
        session=ssf.openSession();
        cm=session.getMapper(companyMapper.class);
    }
    public List<companyInfo> findByUsersId(int usersId){
        return cm.findByUsersId(usersId);
    }
}
